package main

import (
	"io/ioutil"
	"net/http"
	"os"
)

func main() {

	http.HandleFunc("/list/", func(writer http.ResponseWriter, request *http.Request) {
		path := request.URL.Path[len("/list/"):]
		open, err := os.Open(path)
		if err != nil {
			panic(err)
		}
		defer open.Close()

		all, err := ioutil.ReadAll(open)
		if err != nil {
			panic(err)
		}
		writer.Write(all)

	})
	err := http.ListenAndServe(":8888", nil)
	if err != nil {
		panic(err)
	}

}
